import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router);

function route(path, file, name, children) {
  return {
    exact: true,
    path,
    name,
    children,
    component: () => import('../pages' + file)
  }
}

export default new Router({
  routes: [
    {
      path: "/",
      component: () => import('../pages/Layout'),
      redirect: "/index/dashboard",
      children: [
        //自定义  菜单路径=>页面路径
        route("/index/dashboard", "/Dashboard", "Dashboard"),
        route("/item/point", '/item/Point', "Point"),
        route("/item/line", '/item/Line', "Line"),
        route("/item/map", '/item/Map', "Map"),
        route("/item/xingzheng", '/item/XingZheng', "XingZheng"),
        route("/item/test", '/item/Test', "Test"),

      ]
    }
  ]
})
